import store from "./redux";
import { increment, decrement } from "./redux/actions";

export default function App() {
  // 读取数据
  const state = store.getState();

  // 更新
  const handleIncrement = () => {
    store.dispatch(increment(1));
  };

  const handleDecrement = () => {
    store.dispatch(decrement(1));
  };

  return (
    <div>
      <h1>点击次数：{state}</h1>
      <button onClick={handleIncrement}>增加</button>
      <button onClick={handleDecrement}>减少</button>
    </div>
  );
}
